﻿using Microsoft.Practices.Unity;
using Sasa.QualityTools.CodeAnalysis.Core.VisualStudio;
using Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Commands.Behaviors;

namespace Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Commands
{
    [MenuCommand(Constants.Package.Id, Constants.Package.ShowCodeInspectionResult)]
    public class ShowCodeAnalysisResultCommand : CommandBase<CommandExecutionContext>, ICommandBehavior<CommandExecutionContext>
    {
        public ShowCodeAnalysisResultCommand(IUnityContainer container)
            : base(container)
        {
            Behaviors.Add(this);
        }

        public void Behave(CommandExecutionContext context)
        {
            var ide = Container.Resolve<IIde>();
            ide.FindCodeInspectionResultView().Show();
        }
    }
}
